<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@page contentType="text/html; charset=gb2312"%>
<%@page import="com.tss.util.*"%>
<%@page import="com.jedi.*"%>
<%@page import="com.store.*"%>
<%@include file="../global_var.jsp"%>
<%@include file="../check_login.jsp"%>
<%

String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
String cmd = ParamUtils.getParameter(request,"cmd","");
String conid=ParamUtils.getParameter(request,"conid","0");
String engid=ParamUtils.getParameter(request,"engid","");

  List    listmaters=null;
  String strErr = "";
String productname = "";
String productid="";
boolean dispaly_usprice=false;//控制显示美金价格
String  price ="0.00";
String usprice ="0.00";
String [] str_info=null;//用数组存取产品信息


 UserMgr  userMgr = new UserMgr ();
	if (cmd.trim().equals("insert")) {

		if (strErr.trim().equals("")){
	
		Techconeng techconeng = new Techconeng();
		techconeng.setConid(Integer.parseInt(conid));
		techconeng.setTaskid(0); 
		techconeng.setEngid(engid);
		techconeng.insert();
		if (techconeng.hasErr()) strErr = techconeng.getErrHtml();
	}
	
}
%>
<html>
<head>
	<base href="<%=basePath%>">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title></title>
<link href="style/main.css" rel="stylesheet" type="text/css">
<script language="javascript" src="js/common.js"></script>
   	<script language="javascript">
   	function clk_submit() {
var oForm = document.pageForm;
	oForm.cmd.value = "insert";
	return true;	
}

   </script>

</head>

<body bgcolor="#FFFFFF" leftmargin="5" topmargin="5" marginwidth="5" marginheight="5" scroll="yes">
<center>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr align="center"> 
    <td height="30"><b>添加工程师</b></td>
  </tr>
</table>
<table width="90%" border="0" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
  <form name="pageForm" method="post" onsubmit="return clk_submit();">
  	<table width="90%" border="0" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
  <%if (!strErr.trim().equals("")) {%>
  <tr> 
    <td height="24" width="30%" bgcolor="#D7D7DB" style="padding-right:5px;" align="right">错误提示：</td>
    <td bgcolor="#EDEDF0" style="padding-left:5px;">
      <font color=red><%=strErr%></font>
    </td>
  </tr>
  <%}%>
<tr> 
   		 <td height="24" width="30%" bgcolor="#D7D7DB" style="padding-right:5px;" align="right">工程师姓名：</td>
		  <td bgcolor="#EDEDF0" style="padding-left:5px;">
		  <select  name="engid" style="display:inline"   style="width:130px">
				 <OPTION value="">==请选择==</option>
 				  <%
 				  String roleid="engineer";
 				  List listEngs=userMgr.getUsersGroupbyroleid(roleid);
              if (listEngs != null && listEngs.size() > 0) {
                    	for(int i=0;i<listEngs.size();i++) {
                    		User item = (User)listEngs.get(i);
                    %>
                    <option value="<%=item.getId()%>" <%if (item.getId().trim().equals(engid)) {%> selected<%}%>><%=item.getUserName()%></option>
                    <%
                    }
                    }
                    %>
			</select>
		</td>
	</tr>
 
  
   
 
   <tr align="center"> 
    <td bgcolor="#EDEDF0" height="30" colspan="2">
      <input type="submit" class="submit" value="确定"  name="send_value"  >
			<input type="button" class="button" value="关闭"   onclick="javascript:window.close()">
			<input type="hidden" name="cmd" value="">
			<input type="hidden" name="conid" value="<%=conid %>">
			
    </td>
  </tr>
  </table>
  </form>
</table>
</center>
<%if (cmd.trim().equals("insert") && strErr.trim().equals("")) {%>
<script language="javascript">
alert("OK，信息添加成功!");
top.returnValue="yes";
top.close();
</script>
<%}%>
</body>
</html>
